//
// Created by Never on 2019/10/28.
//

#ifndef MODELFORLRP_SOLUTIONFORLRP_H
#define MODELFORLRP_SOLUTIONFORLRP_H

#include <vector>

class SolutionForLRP{
public:
    std::vector<bool> solution;
    std::vector<int> routes;
    int depotCost;
    int vehicleCost;
    int routeCost;
    int totalCost;

    int computeTotalCost()
    {
        return depotCost+vehicleCost+routeCost;
    }

    SolutionForLRP(const SolutionForLRP& sol)
    {
        totalCost = sol.totalCost;
        solution = sol.solution;
        depotCost = sol.depotCost;
        vehicleCost = sol.vehicleCost;
        routeCost = sol.routeCost;
        routes = sol.routes;
    }

    SolutionForLRP(std::vector<bool> sol, std::vector<int> routes, int depotCost, int vehicleCost, int routeCost):
    solution(std::move(sol)), depotCost(depotCost), vehicleCost(vehicleCost), routeCost(routeCost), routes(routes),
    totalCost(computeTotalCost()){}

    SolutionForLRP(std::vector<bool> sol, int totalCost):solution(std::move(sol)), totalCost(totalCost){};

    SolutionForLRP(int totalCost):totalCost(totalCost){};

    bool operator!=(const SolutionForLRP& sol)
    {
        return solution != sol.solution;
    }

    bool operator<(const SolutionForLRP& sol)
    {
        return totalCost < sol.totalCost;
    }
};

#endif //MODELFORLRP_SOLUTIONFORLRP_H
